Total Complexity | 1 |
Total Lines | 10 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import { QueryHandler } from '@nestjs/cqrs'; |
||
5 | |||
6 | @QueryHandler(CountShootingsBySchoolQuery) |
||
7 | export class CountShootingsBySchoolQueryHandler { |
||
8 | constructor( |
||
9 | @Inject('IShootingRepository') |
||
10 | private readonly shootingRepository: IShootingRepository |
||
11 | ) {} |
||
12 | |||
13 | public execute({ schoolId }: CountShootingsBySchoolQuery): Promise<number> { |
||
14 | return this.shootingRepository.countBySchool(schoolId); |
||
15 | } |
||
17 |